<template>
	<view>
		<view class="downApp">
			<!-- #ifdef MP-WEIXIN -->
			<image src="https://jg.vjigong.com/vipimg/ioswxapp.jpg" show-menu-by-longpress="true" mode="widthFix"></image>
			<!-- #endif -->
			
			<!-- #ifdef APP-PLUS -->
			<image src="https://jg.vjigong.com/vipimg/app.jpg" show-menu-by-longpress="true" mode="widthFix" @click="downImg"></image>
			<!-- #endif -->
			
			
		</view>
		
	</view>
</template>

<script>
	export default {
		data(){
			return{
				platform:"",
			}
		},
		onShow(){
			let platform = uni.getSystemInfoSync().platform;
			this.platform=platform;
		},
		methods:{
			downImg(){
				//下载图片资源至本地，返回文件的本地临时路径
				uni.downloadFile({
					url:'https://jg.vjigong.com/vipimg/app.jpg',
					success: (res) =>{
					  if (res.statusCode === 200){
						//保存图片至相册
						uni.saveImageToPhotosAlbum({
						  filePath: res.tempFilePath,
						  success: function() {
							uni.showModal({
								title:'保存成功',
								content:'图片已保存到相册中，请识别二维码继续下一步',
								showCancel:false,
								
							})
						  },
						  fail: function() {
							uni.showToast({
							  title: "保存失败，请稍后重试",
							  icon: "none"
							});
						  }
						});
					  }
					}
				})
			},
			copyText(){
				uni.setClipboardData({
				  data:'https://jg.vjigong.com/apk/index.html',//要被复制的内容
				  success:()=>{//复制成功的回调函数
					uni.showToast({//提示
					  title:`复制成功`,
					  icon:'success'
					})
				  }
				},true);
			},
		},
	}
	
</script>

<style>
	.downApp{
		width: 100%;
	}
	.downApp image{
		width: 100%;
	}
	.downBtnBox{
		height: 200rpx;
		width: 100%;
		display: flex;
		padding: 0 20rpx;
	}
	.downBtn{
		flex: 1;
		border: 2rpx solid #327fe8;
		margin: 50rpx 30rpx;
		height:90rpx;
		line-height: 90rpx;
		border-radius: 50rpx;
		text-align: center;
	}
	.noticeText{
		padding: 0 20rpx 100rpx 20rpx;
		line-height: 50rpx;
		font-size: 26rpx;
	}
</style>